class Logger:

    def __init__(self, func):

        self.__func = func

    # 类装饰器必须实现__call__魔术方法
    def __call__(self, *args, **kewargs):

        print("执行前===", args, kewargs)
        result = self.__func(*args, **kewargs)

        print("执行后===result", result)
        return result


@Logger
def greeting(name):
    print(f"你好:{name}")


# fun = Logger(greeting)
greeting("susan")


logger = Logger(greeting, age=10)

logger("linda")
